<%--
  Created by IntelliJ IDEA.
  User: zjk
  Date: 2018-08-03
  Time: 21:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>客户需求表</title>

</head>
<body>
<style>
    .by {
        padding: 10px;
        text-align: center;
    }

</style>
<!-- 引入公用表格和表单样式 -->
<link href="css/utils/utilsDatagrid.css" rel="stylesheet" type="text/css">
<link href="css/utils/utilsForm.css" rel="stylesheet" type="text/css">
<!-- 引入 详情样式-->
<link href="css/utils/utilsDetails.css" rel="stylesheet" type="text/css">
<!--引入时间转换js-->
<script type="text/javascript" src="js/utils/DateFormate.js"></script>
<!--引入客户需求js-->
<script type="text/javascript" src="js/before-sale/clientNeed.js"></script>

<div class="easyui-layout"  data-options="fit:true, border:false">
    <div data-options="region:'center'" style="padding:5px;">
        <table id="zjk-need-dg" class="easyui-datagrid table-chance"  data-options="fit:true,striped:true,fitColumns:true,checkOnSelect:false,
   autoRowHeight:true,nowrap:false,pagination:true,toolbar:'#zjk-need-tools',scrollbarSize:0,
pageList:[5,10,15,20],pageSize:5,
url:'showClientNeedList',method:'post'">
            <thead>
            <tr class="datagrid-header-row">
                <th data-options="field:'needId',width:30,align:'center',checkbox:true">ID</th>
                <th data-options="field:'needTheme',width:100,align:'center'">需求主题</th>
                <th data-options="field:'chanceId',width:60,align:'center',formatter:function(value){
							var result;
							$.ajax({
								url:'getSaleChanceThemeById',
								async:false,//改为同步请求
								type:'POST',
								data:{chId:value},
								success:function(e){
									result = e;
								}
							});
							return result;
						}">对应机会</th>
                <th data-options="field:'clientId',width:70,align:'center',formatter:function(value){
							var result;
							$.ajax({
								url:'get-client-name',
								async:false,//改为同步请求
								type:'POST',
								data:{clientId:value},
								success:function(e){
									result = e;
								}
							});
							return result;
						}">客户</th>
                <th data-options="field:'importance',width:40,align:'center'">重要程度</th>
                <th data-options="field:'contactId',width:50,align:'center',formatter:function(value){
							var result;
							$.ajax({
								url:'get-contact-name',
								async:false,//改为同步请求
								type:'POST',
								data:{contactId:value},
								success:function(e){
									result = e;
								}
							});
							return result;
						}">联系人</th>
                <th data-options="field:'recordTime',width:60,align:'center'">记录时间</th>
                <th data-options="field:'operation',width:60,align:'center'" formatter="format">操作</th>

            </tr>
            </thead>
            <tbody>

            </tbody>
        </table>
        <!--工具栏-->
        <div id="zjk-need-tools">
            <a id="zjk-add-need-open-dialog-btn"  class="easyui-linkbutton"data-options="iconCls:'icon-mini_add2',plain:true">新建</a>
            <a  id="delete-clientNeed-btn" class="easyui-linkbutton"data-options="iconCls:'icon-my_delete',plain:true">删除</a>

            <a id="find-all-need-btn" class="easyui-linkbutton" data-options="iconCls:'icon-my_search',plain:true">查询所有</a>

            <input id="need-search" class="easyui-searchbox" style="width: 250px" data-options="menu:'#clientNeed-mm'"/>
            <!--搜索框菜单-->
            <div id="clientNeed-mm" style="width:120px">
                <div data-options="name:'needTheme'">需求主题</div>
                <div data-options="name:'importance'">重要程度</div>

                <%--<a id="advance-search-btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-my_search'">高级查询</a>--%>
            </div>
        </div>
    </div>
</div>
//添加窗口
<div id="zjk-add-need-dialog" class="easyui-dialog" style="background-color:#EBEFF2;" data-options="title:'新增客户需求',modal:true,
			iconCls:'icon-save2',
			width:'50%',
			height:'60%',
			closed:true,
			href:'zjk-need-form',
			bodyCls:'by',
			shadow:true,
			buttons:'#zjk-need-add-dialog-bb'"></div>
//编辑窗口
<div id="zjk-edit-need-dialog" class="easyui-dialog" style="background-color:#EBEFF2;" data-options="title:'修改客户需求',modal:true,
			iconCls:'icon-save2',
			width:'50%',
			height:'60%',
			closed:true,
			href:'zjk-edit-need-form',
			bodyCls:'by',
			shadow:true,
			buttons:'#zjk-need-edit-dialog-bb'"></div>
//详情视图窗口
<div id="zjk-need-details" class="easyui-dialog" style="background-color:#EBEFF2;" data-options="title:'客户需求详情',modal:true,
			iconCls:'icon-save2',
			width:'50%',
			height:'60%',
			closed:true,
			href:'zjk-need-details',
			shadow:true

			 "></div>
//添加窗口按钮
<div id="zjk-need-add-dialog-bb">
    <a href="#" id="zjk-need-add-dialog-bb-save" class="easyui-linkbutton"
       data-options="iconCls:'icon-ok2'">保存</a>
    <a href="#" id="zjk-need-add-dialog-bb-close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel2',onClick:function(){
    $('#zjk-add-need-dialog').dialog('close')
    }">关闭</a></div>

//编辑窗口按钮
<div id="zjk-need-edit-dialog-bb">
    <a href="#" id="zjk-need-edit-dialog-bb-save" class="easyui-linkbutton"
       data-options="iconCls:'icon-ok2'">保存</a>
    <a href="#" id="zjk-need-edit-dialog-bb-close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel2',onClick:function(){
    $('#zjk-edit-need-dialog').dialog('close')
    }">关闭</a></div>



</body>
</html>
